package com.panfeng.xcloud.boss.provider.member.web.rpc;

import com.panfeng.xcloud.boss.provider.dto.request.SyncBasicInfoReqDTO;
import com.panfeng.xcloud.boss.provider.rpc.member.MemberBasicInfoFeignApi;
import com.panfeng.xcloud.common.core.configuration.DataDictionaryConfig;
import com.panfeng.xcloud.common.core.utils.BeanUtils;
import com.panfeng.xcloud.common.core.web.vo.ResponseVO;
import com.panfeng.xcloud.common.security.annotation.NotNeedAccess;
import com.panfeng.xcloud.common.security.annotation.NotNeedFeignAccess;
import com.panfeng.xcloud.common.security.web.support.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(value = "API - MemberBasicInfoApiFeignClient", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class MemberBasicInfoApiFeignClient extends BaseController implements MemberBasicInfoFeignApi {

    @Autowired
    private DataDictionaryConfig dataDictionaryConfiguration;

    @NotNeedAccess
    @NotNeedFeignAccess
    @PostMapping(value = "/feignApi/member/syncInfo", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(httpMethod = "POST", value = "rest-rpc处理syncBasicInfo操作")
    @Override
    public ResponseVO syncBasicInfo(@RequestBody SyncBasicInfoReqDTO syncBasicInfoReqDTO) {
        dataDictionaryConfiguration.setCodeToNameMap(syncBasicInfoReqDTO.getCodeToNameMap());
        return ResponseVO.success();
    }

}
